﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
//同一个命名空间下可以调用其它类
namespace 贪吃蛇
{
    enum E_SnakeBody_Type
    {
        Head,
        Body,
    }
    internal class SnakeBody:GameObject
    {
        private E_SnakeBody_Type type;   //蛇的类型名 用于调用枚举
        public SnakeBody(E_SnakeBody_Type type, int x,int y)     //选择蛇类型
        {
        this.type = type;
        pos = new Position(x,y);
             
        }

        public override void Draw()
        {  
            Console.SetCursorPosition(pos.x, pos.y);
            Console.ForegroundColor = type == E_SnakeBody_Type.Head ? ConsoleColor.Yellow : ConsoleColor.Green;
            Console.Write(type == E_SnakeBody_Type.Head ? "●" : "○");
        }
    }
}
